package models

import (
	"time"
)

type SysJobLog struct {
	ID        uint      `json:"id" gorm:"primarykey"`
	JobID     int       `json:"jobId" gorm:"comment:任务ID"`
	JobName   string    `json:"jobName" gorm:"type:varchar(100);comment:任务名称"`
	NodeID    string    `json:"nodeId" gorm:"type:varchar(100);comment:节点ID"`
	JobGroup  int       `json:"jobGroup" gorm:"size:4;comment:任务分组"`
	Args      string    `json:"args" gorm:"type:varchar(255);comment:执行参数"`
	Status    int       `json:"status" gorm:"type:varchar(10);comment:状态 success/fail"`
	ErrorMsg  string    `json:"errorMsg" gorm:"type:text;comment:错误信息"`
	StartTime time.Time `json:"startTime" gorm:"index:idx_job_log_time;comment:开始时间"`
	Duration  int64     `json:"duration" gorm:"comment:耗时（毫秒）"`
	EndTime   time.Time `json:"endTime" gorm:"comment:结束时间;default:NULL;"`
}

func (*SysJobLog) TableName() string {
	return "sys_job_log"
}
